package com.xtoneict.auth.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xtoneict.auth.entity.Permission;
import com.xtoneict.auth.mapper.PermissonMapper;
import com.xtoneict.auth.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionServiceImpl extends ServiceImpl<PermissonMapper, Permission> implements IPermissionService {
    @Autowired
    private PermissonMapper permissonMapper;

    public List<Permission> selectPermissionByRoleId(Integer roleId){
        List<Integer> permissionIds = permissonMapper.selectPermissionByRoleId(roleId);

        return permissonMapper.selectBatchIds(permissionIds);
    }
}
